package com.mixsmart.commonweb.bean.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.mixsmart.commonweb.bean.IPKStringBean;

/**
 * URL资源与操作标示关联--实体类
 * @author lmq
 * @version 1.0
 * @since JDK版本大于等于1.6
 * 2016年3月8日
 */
@Entity
@Table(name="t_c_url_res_op_flag")
public class TCUrlResOpFlag implements IPKStringBean {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4321396953051359028L;

	private String id;
	
	/**
	 * 操作标示ID（即TCOperateFlag实体属性对应的ID）
	 */
	private String opFlagId;
	
	/**
	 * URL资源ID
	 */
	private String urlResId;
	
	/**
	 * 查看页面资源地址
	 */
	private String viewUrlResId;
	
	/**
	 * 提交数据资源地址
	 */
	private String postUrlResId;
	
	/*********非持久化属性（即：临时变量）********/
	/**
	 * 页面地址(非持久化属性)
	 */
	private String viewUrl;
	
	/**
	 * 提交后的地址(非持久化属性)
	 */
	private String postUrl;

	@Id
	@Column(name="id",length=50)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name="op_flag_id",length=50,nullable=false)
	public String getOpFlagId() {
		return opFlagId;
	}

	public void setOpFlagId(String opFlagId) {
		this.opFlagId = opFlagId;
	}

	@Column(name="url_res_id", length=50, nullable=false)
	public String getUrlResId() {
		return urlResId;
	}

	public void setUrlResId(String urlResId) {
		this.urlResId = urlResId;
	}

	@Column(name="view_url_res_id", length=50)
	public String getViewUrlResId() {
		return viewUrlResId;
	}

	public void setViewUrlResId(String viewUrlResId) {
		this.viewUrlResId = viewUrlResId;
	}

	@Column(name="post_url_res_id", length=50)
	public String getPostUrlResId() {
		return postUrlResId;
	}

	public void setPostUrlResId(String postUrlResId) {
		this.postUrlResId = postUrlResId;
	}

	
	/*********非持久化属性（即：临时变量）********/
	@Transient
	public String getViewUrl() {
		return viewUrl;
	}

	public void setViewUrl(String viewUrl) {
		this.viewUrl = viewUrl;
	}

	@Transient
	public String getPostUrl() {
		return postUrl;
	}

	public void setPostUrl(String postUrl) {
		this.postUrl = postUrl;
	}

	@Override
	public boolean equals(Object obj) {
		if(null == obj) {
			return false;
		} else {
			if(this.getClass() == obj.getClass()) {
				TCUrlResOpFlag resOpFlag = (TCUrlResOpFlag)obj;
				return this.id.equals(resOpFlag.getId());
			} else {
				return false;
			}
		}
	}
	
}
